package com.cooper.dao.account;

import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.Insert;
import net.paoding.rose.jade.annotation.SQL;

import com.cooper.entity.MessageEntity;

@DAO
public interface MessageDAO {

	static final String TABLE_NAME = "d_message";
	
	@Insert(tableName=TABLE_NAME)
	Long createMessage(MessageEntity entity) throws Exception;
	
	@SQL("update d_message set modifier=:1.modifier,creator=:1.creator,gmt_create=:1.gmtCreate,gmt_modified=:1.gmtModified,category=:1.category," +
			"from_user_id=:1.fromUserId,to_user_id=:1.toUserId,is_read=:1.isRead,content=:1.content"
			+ " where id=:1.id")
	public void updateReply(MessageEntity entity);
}
